package com.kh.pajx.sop.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.kh.pajx.sop.base.BaseDaoImpl;
import com.kh.pajx.sop.dao.IHsSchoolRelationDao;
import com.kh.pajx.sop.domain.HsSchoolRelation;

/**
 * 学校扩展信息持久化操作实现类
 * @author:	azzcsimp
 * @Createdate:	2014年7月28日 上午9:48:57
 */
@Repository
@SuppressWarnings("unchecked")
public class HsSchoolRelationDaoImpl extends BaseDaoImpl<HsSchoolRelation> implements IHsSchoolRelationDao {

	
	@Override
	public List<HsSchoolRelation> getRelation(String sclId){
		return getSession().createQuery("FROM HsSchoolRelation sr WHERE sr.sclId = ? ")
				.setParameter(0, sclId)
				.list();
	}
	
	@Override
	public List<HsSchoolRelation> getRelationByFlag(String sclId, String flag){
		return getSession().createQuery("FROM HsSchoolRelation sr WHERE sr.sclId = ? and sr.relationStatusFlag = ?")
				.setParameter(0, sclId)
				.setParameter(1, flag)
				.list();
	}
	
}
